package com.epic.provider;

import com.epic.inter.assetmgr.IAsset;
import com.epic.services.IAssetImpl;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.CountDownLatch;

public class Application {
        private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1");

        public static void main(String[] args) throws Exception {
//            ServiceConfig<IAsset> service = new ServiceConfig<>();
//            service.setApplication(new ApplicationConfig("first-dubbo-provider"));
//            service.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
//            service.setProtocol(new ProtocolConfig("dubbo"));
//            service.setInterface(IAsset.class);
//            service.setRef(new IAssetImpl());
//            service.export();
//
//            System.out.println("dubbo service started");
//            new CountDownLatch(1).await();

            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
            System.out.println("00");
            context.start();
            System.out.println("start..");
            System.in.read();

    }
}
/**
 * mvn clean package
 * # mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.provider.Application exec:java
 */

















